#pragma once
#include "SearchNode.h"
#include <assert.h>
class NodesHashtable
{
private: 
	int empty;                      /* index of first free location in hash table */
	int* bucket;   /* pointer to first element in table with given hash value */
	int stored;
	int maxCapacity;
public:
	SearchNode* nodes;

	NodesHashtable(int maxCapacity);
	~NodesHashtable(void);
	long hash(unsigned int ps[WORDS]);
	int search (unsigned int ps[WORDS],int hashval);
	int search (unsigned int ps1, unsigned int ps2); // Slower, used for debug only
	int insert(unsigned int ps[WORDS],int hashval,int oldblank,int g,int h, int cost,int parentIndex);
	bool isFull(); // Checks if the number of nodes stored exceeds the maximum capacity
};
